/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package score;

import length.Length;

/**
 *
 * @author Daniel Gribel
 */
public class LengthDependedScore extends Score {
    private int weight;
    private Length length;

    public LengthDependedScore(Length length, int weight) {
        super();
        this.length = length;
        this.weight = weight;
    }

    @Override
    public void applyScore(int counter) {
        if (counter > 0 && counter < length.getLength())
            setFinalScore((length.getLength() - counter) * weight);
        else setFinalScore(0);
    }
}
